<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="author" content="www.cnadlm.com" />
<link href="<?=domain?>static/style/union.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=domain?>static/script/core.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/script/home.js" charset="utf-8"></script>
<title><?=name?>-自定义链接</title>
<body>
<div class="nav">
	<div class="list">
		<ul>
		  <?php
		  foreach($menu as $key=>$value){
		  ?>
		  <li><a href="<?=($value['value'])?>"><?=$value['name']?></a></li>
		  <?php
		  }
		  ?>
		 </ul>
	</div>
</div>
<div class="main">
	<div class="logo"><a href="<?=domain?>"><img src="<?=domain?>static/image/Logo.png"></a></div>
	<div class="content">
		<div class="home_nav">
			<div class="l"></div>
			<div class="c">
		        <ul>
		          <?php
		          	$current=-1;
					foreach($HomeMenu as $key=>$value){
						if(stripos($_SERVER['SCRIPT_NAME'],substr($value['value'],0,strpos($value['value'],'/')))){
							$current=$key;
						}
				  ?>
		          <li<?=($current==$key?' class="sel"':'')?>><a href="<?=domain?>home/<?=$value['value']?>"><?=$value['name']?></a></li>
		          <?php
					}
		          ?>
		          <li><a href="<?=domain?>action/logout.php">安全退出</a></li>
		        </ul>
			</div>
			<div class="r"></div>
		</div>
		<div class="manage">
			<div class="left">
				<div class="module">
					<div class="bar"><div>自定义链接</div></div>
					<div class="handle">
						<?php
							if(!empty($message)){
								foreach($message['msg'] as $key => $value){
						?>
						<div class="message <?=$message['result']?'success':'error';?>">
							<div class="msg"><?=$message['msg'][$key]?></div>
							<div class="close"></div>
						</div>
						<?php
							}}
						?>
						<form name="info" method="post" action="<?=domain?>home/account/info.php">
						<div class="action">自定义链接</div>
						<div class="form">
							<div class="m">链接种类：</div>
							<div class="s">
								<select size="1" name="type" style="width:253px;">
									<option value="0">文字链接</option>
									<option value="1">图片链接</option>
								</select>
							</div>
							<div class="e c"><font color="red">*</font>,图片和文字链两种自定义功能.</div>
						</div>
						<div class="form">
							<div class="m" id="wi">文字内容：</div>
							<div class="s"><input type="text" name="wi" value="" size="30" maxlength="32"/></div>
							<div class="e c"><font color="red">*</font>,请填写文字链内容或图片源链接.</div>
						</div>
						<div class="form">
							<div class="m">目标URL：</div>
							<div class="s"><input type="text" name="url" value="http://" size="30" maxlength="32"/></div>
							<div class="e c"><font color="red">*</font>,用户点击广告后到达的页面.</div>
						</div>
						<div class="form"><input type="button" name="ok" value="确定" class="bg"/></div>
						<div class="form" style="position:relative;">
						  <div copy="true" class="copy" style="width:420px;height:80px;margin-left:142px;">&lt;a href="<?=$customize?>?tactic=customize.<?=$member?>&url={url}" target="_blank"&gt;{wi}&lt;/a&gt;</div>
						  <div class="zcopy" style="width:425px;height:85px;position:absolute;top:0px;left:116px;"></div>
						</div>
						</form>
					</div>
				</div>
			</div>
			<div class="right">
				<div class="module">
					<div class="bar"><div><?=($HomeMenu[$current]['name'])?></div></div>
					<div class="handle">
						<?php
							foreach($HomeMenu[$current]['child'] as $key=>$value){
						?>
						<a href="<?=domain?>home/<?=$value['value']?>"><?=(stripos($_SERVER['SCRIPT_NAME'],strrchr($value['value'],'/'))!==false?'▬&nbsp;':'')?><?=$value['name']?></a>
						<?php
							}
						?>
					</div>
				</div>
			</div>
		</div>
		<div class="footer">
			<?=$foot?>
		</div>
	</div>
</div>
</body>
</html>
<script language="JavaScript" type="text/javascript">
var customize={'word':'<a href="<?=$customize?>?tactic=customize.<?=$member?>&url={url}" target="_blank">{wi}</a>','image':'<a href="<?=$customize?>?tactic=customize.<?=$member?>&url={url}" target="_blank"><img src="{wi}"></a>'};
ZeroClipboard.swf='<?=domain?>static/script/Clipboard.swf';
$("select[name='type']").change(function(){
		if($(this).attr('value')=='0'){
			$('#wi').text('文字内容：');
			$('input[name="wi"]').attr('value','');
		}else{
			$('#wi').text('图片URL：');
			$('input[name="wi"]').attr('value','http://');
		}
});
$('input[name="ok"]').click(function(){
		var wi=$('input[name="wi"]').attr('value'),url=encodeURI($('input[name="url"]').attr('value')),code="";
		if($('select[name="type"]').attr('value')=='0'){code=customize.word;}else{code=customize.image;}
		code=code.replace(/{wi}/g,wi);code=code.replace(/{url}/g,url);
		$('div[copy="true"]').text(code);
		ZeroClipboard.setText($('div[copy="true"]').text());
});
</script>